Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: server-sent-event example should use c.Writer.CloseNotify() chan #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justintoman
Copy link

I was basing an app off this example, and I was noticing that clients weren't getting closed until I tried (and failed) to send messages to disconnected clients.

Example: I'm connected to the SSE stream, then close the browser window. The log.Printf("Removed client") doesn't show up until after I try to send the next message to closed browser window.

Using c.Writer.CloseNotify() appears to work immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant